import request from '../utils/request'
export const articleDttail = (article: string) => {
  return request({
    url: `/article/${article}`
  })
}
/**
 * 创建文章
 * @param data
 */
export const createArticle = (data: { title: string; content: string }) => {
  return request({
    url: '/article/create',
    method: 'POST',
    data
  })
}
export const editorArticle = (data: {
  id: string
  title: string
  content: string
}) => {
  return request({
    url: '/article/edit',
    method: 'POST',
    data
  })
}
/**
 * 获取所有文章
 * @param data
 */
export const articleList = (data: any) => {
  return request({
    url: '/article/list',
    method: 'POST',
    data
  })
}
/**
 * 获取所有文章
 * @param data
 */
export const articleSort = (data: any) => {
  return request({
    url: '/article/sort',
    method: 'POST',
    data
  })
}
/**
 *
 * @param id
 */
export const articleDetail = (id: string) => {
  return request({
    url: `/article/detail/${id}`
  })
}
/**
 *删除文章
 * @param id
 */
export const deleteArticle = (id: string) => {
  return request({
    url: `/article/delete/${id}`
  })
}
